﻿CREATE TABLE [dbo].[WxPayNotifyLog](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[SignType] [nvarchar](8) NULL,
	[ServiceVersion] [nvarchar](8) NULL,
	[InputCharset] [nvarchar](8) NULL,
	[Sign] [nvarchar](32) NULL,
	[SignKeyIndex] [int] NULL,
	[TradeMode] [int] NULL,
	[TradeState] [int] NULL,
	[PayInfo] [nvarchar](64) NULL,
	[Partner] [nvarchar](10) NULL,
	[BankType] [nvarchar](16) NULL,
	[BankBillNo] [nvarchar](32) NULL,
	[TotalFee] [int] NULL,
	[FeeType] [int] NULL,
	[NotifyId] [nvarchar](128) NULL,
	[TransactionId] [nvarchar](28) NULL,
	[OutTradeNo] [nvarchar](32) NULL,
	[Attach] [nvarchar](128) NULL,
	[TimerEnd] [nvarchar](14) NULL,
	[TransportFee] [int] NULL,
	[ProductFee] [int] NULL,
	[Discount] [int] NULL,
	[BuyerAlias] [nvarchar](64) NULL, 
    [PostAppId] NVARCHAR(50) NULL, 
    [PostTimeStamp] NVARCHAR(50) NULL, 
    [PostNonceStr] NVARCHAR(50) NULL, 
    [PostOpenId] NVARCHAR(50) NULL, 
    [PostAppSignature] NVARCHAR(50) NULL, 
    [PostIsSubscribe] NVARCHAR(50) NULL,
    [RecCreateDt] DATETIME NULL, 
    CONSTRAINT [PK_WxPayNotifyLog] PRIMARY KEY ([Id])
)

GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'签名方式, 签名类型，取值：MD5、RSA，默认：MD5' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'SignType'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'接口版本，版本号，默认为 1.0' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'ServiceVersion'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字符集, 字符编码,取值：GBK、UTF-8，默认：GBK' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'InputCharset'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'签名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'Sign'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'密钥序号, 多密钥支持的密钥序号，默认 1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'SignKeyIndex'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'交易模式, 1-即时到账' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'TradeMode'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支付结果信息, 支付结果信息,支付成功时为空' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'TradeState'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支付结果信息,支付成功时为空' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'PayInfo'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商户号，也即之前步骤的 partnerid,由微信统一分配的 10 位正整数(120XXXXXXX)号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'Partner'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'银行类型，在微信中使用 WX' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'BankType'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'银行订单号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'BankBillNo'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支付金额，单位为分，如果 discount有值，通知的 total_fee + discount = 请求的 total_fee' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'TotalFee'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'现金支付币种, 目前只支持人民币,默认值是 1-人民币' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'FeeType'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支付结果通知 id，对亍某些特定商户，只返回通知 id，要求商户据此查询交易结果' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'NotifyId'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'交易号， 28 位长的数值，其中前 10位为商户号，之后 8 位为订单产生的日期，如 20090415，最后 10 位是流水号。' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'TransactionId'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商户系统的订单号，与请求一致。' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'OutTradeNo'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商户数据包，原样返回' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'Attach'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支付完成时间，格式为yyyyMMddhhmmss，如 2009 年 12月 27 日 9 点 10 分 10 秒表示为20091227091010。时区为 GMT+8 beijing。' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'TimerEnd'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'物流费用，单位分，默认 0。如果有值，必须保证 transport_fee  +  product_fee = total_fee' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'TransportFee'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'物品费用，单位分。如果有值，必须保证 transport_fee  + product_fee=total_fee' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'ProductFee'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'折扣价格，单位分，如果有值，通知的 total_fee  +  discount  =  请求的total_fee' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'Discount'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对应买家账号的一个加密串' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WxPayNotifyLog', @level2type=N'COLUMN',@level2name=N'BuyerAlias'
GO


GO


GO


GO


GO


GO

EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录创建时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxPayNotifyLog',
    @level2type = N'COLUMN',
    @level2name = N'RecCreateDt'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'公众号 id',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxPayNotifyLog',
    @level2type = N'COLUMN',
    @level2name = 'PostAppId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'时间戳',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxPayNotifyLog',
    @level2type = N'COLUMN',
    @level2name = N'PostTimeStamp'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'随机字符串',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxPayNotifyLog',
    @level2type = N'COLUMN',
    @level2name = N'PostNonceStr'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'支付该笔订单的用户 ID',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxPayNotifyLog',
    @level2type = N'COLUMN',
    @level2name = N'PostOpenId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'签名',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxPayNotifyLog',
    @level2type = N'COLUMN',
    @level2name = N'PostAppSignature'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'用户是否关注了公众号。1 为关注，0 为未关注',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxPayNotifyLog',
    @level2type = N'COLUMN',
    @level2name = N'PostIsSubscribe'